




use "${pathdata_mechanism}/MechanismExperiment1.dta", clear



preserve








* ### Belief Movement: Main Table ###	
		
		
		
	* Step 1: Clone the dataset
gen _clone = 1

* Step 2: Replace the values
* For the cloned dataset
replace effect = abs * 100 if _clone == 1
replace effect_recall = abs * 100 if _clone == 1
keep if inlist(treatment, "n=1_context")
keep if product == "restaurant"
replace restaurant_version_ = "bayesian_movement" if _clone == 1 & inlist(treatment, "n=1_context")


duplicates drop


* Step 3: Append the cloned dataset to the original one
append using "${pathdata_mechanism}/MechanismExperiment1.dta", gen(_source)


*keep effect effect_recall bayesian_movement treatment prolific_pid 



	

drop if treatment == "noinfo"

keep if inlist(restaurant_version_, "napoli_italian", "jones_italian", "eatery_italian", "bayesian_movement")

keep if product == "restaurant"


collapse (mean) effect effect_recall (sem) imm_sem = effect del_sem = effect_recall, by(restaurant_version_)
rename imm_sem sem0
rename del_sem sem1
rename effect dev0
rename effect_recall dev1
reshape long sem dev, i(restaurant_version_) j(delay)
gen upper = dev + sem
gen lower = dev - sem


	tw (scatter dev delay if restaurant_version_ == "napoli_italian", connect(l) lcolor(black*0.2) lpattern(solid) msize(vlarge) ms(d) mcolor(black*0.2)) ///
	(scatter dev delay if restaurant_version_ == "eatery_italian", connect(l) lcolor(black*0.5) lpattern(shortdash) msize(vlarge) ms(s) mcolor(black*0.5)) ///
	(scatter dev delay if restaurant_version_ == "jones_italian", connect(l) lcolor(black*1) lpattern(dash_dot) msize(vlarge) ms(o) mcolor(black*1)) ///
	(scatter dev delay if restaurant_version_ == "bayesian_movement", lpattern(longdash) connect(l) msize(0.00001) ms(d) lcolor(black*1.5) mcolor(black*1.5)) ///
	(rcap upper lower delay if restaurant_version_ == "napoli_italian", lw(medthick) lcolor(black*0.2)) ///
	(rcap upper lower delay if restaurant_version_ == "eatery_italian", lw(medthick) lcolor(black*0.5))	///
	(rcap upper lower delay if restaurant_version_ == "jones_italian", lw(medthick) lcolor(black*1)), ///
	ytitle("Mean belief impact {c 177} SEM" "(percentage points)") ///
		xtitle(" ") xsc(r(-0.5 1.5) lcolor(none)) ysc(r(0 20) lcolor(none)) ///
		yline(0, lcolor(gs10) lwidth(thin)) ///
		graphregion(color(white)) title("Belief impact in {it:Immediate} and {it:Delay}",  margin(b=3) color(black)) ///
		ylabel(0 5 10 15 20, tlc(none) angle(0) glcolor(gs15) glwidth(thin)) ///
	legend(order(1 2 3 4) label(1 "High Similarity" "(Italian Restaurant Napoli)") label(2 "Low Similarity 1" "(Eatery)") label(3 "Low Similarity 2" "(Mr. Jones)") label(4 "Bayesian" "Benchmark")r(1)) ///
		xlabel(0 "Immediate" 1 "1-day delay") ysize(5) xsize(10)
	graph export "${pathout_mechanism}/figures/figure4a.pdf", replace

restore






* Combined Recall

preserve



drop if treatment == "noinfo"

keep if inlist(restaurant_version_, "napoli_italian", "jones_italian", "eatery_italian")

keep if product == "restaurant"

collapse (mean) correct_recall (sem) stderr = correct_recall, by (restaurant_version_)
rename correct_recall  dev
gen upper = dev + stderr
gen lower = dev - stderr

	gen treatment_num = .
replace treatment_num = 1 if restaurant_version_ == "napoli_italian"
replace treatment_num = 2 if restaurant_version_ == "eatery_italian"
replace treatment_num = 3 if restaurant_version_ == "jones_italian"


tw (scatter dev treatment_num if restaurant_version_ == "napoli_italian", connect(l) mcolor(black*0.2) msize(large) ms(d)) ///
   (scatter dev treatment_num if restaurant_version_ =="eatery_italian" , connect(l) mcolor(black*0.5) msize(large) ms(s)) ///
   (scatter dev treatment_num if restaurant_version_ =="jones_italian" , connect(l) mcolor(black*1) msize(large) ms(o)) ///
   (rcap upper lower treatment_num if restaurant_version_ == "napoli_italian", lw(medthick) lcolor(black*0.2)) ///
      (rcap upper lower treatment_num if restaurant_version_ == "eatery_italian", lw(medthick) lcolor(black*0.5)) ///
   (rcap upper lower treatment_num if restaurant_version_ == "jones_italian", lw(medthick) lcolor(black*1)), ///
	graphregion(color(white)) ysc(r(0 1)) ylab(0(0.1)1, angle(horizontal) tlc(none)  glcolor(gs15) glwidth(thin))  ysc(lcolor(none))  xsc(r(0.5 3.5) lcolor(none)) ///
		 		yline(0, lcolor(gs10) lwidth(thin)) ///
	 	title("Correct recall of information type and valence",  color(black)) ysize(5) xsize(10) ///
xlab(1 `" "High Similarity" "(Italian Restaurant Napoli)" "'  2 `" "Low Similarity 1" "(Eatery)" "'  3 `" "Low Similarity 2" "(Mr. Jones)" "' ,valuelabel) xtitle(" " "Condition") ytitle(" " "Mean Rate  {c 177} SEM") leg(off)
	graph export "${pathout_mechanism}/figures/figure4b.pdf", replace



